home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / quad / RCS / Quad_UnsToDouble.c,v < prev   
Encoding:
Text File  |  1991-03-18  |  1.4 KB  |  73 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     91.03.18.12.21.15;  author kupfer;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @Convert an unsigned quad to a double.
  17. @
  18.  
  19.  
  20.  
  21. 1.1
  22. log
  23. @Initial revision
  24. @
  25. text
  26. @/* 
  27.  * Quad_UnsToDouble.c --
  28.  *
  29.  *    Quad_UnsToDouble libc routine.
  30.  *
  31.  * Copyright 1991 Regents of the University of California
  32.  * Permission to use, copy, modify, and distribute this
  33.  * software and its documentation for any purpose and without
  34.  * fee is hereby granted, provided that this copyright
  35.  * notice appears in all copies.  The University of California
  36.  * makes no representations about the suitability of this
  37.  * software for any purpose.  It is provided "as is" without
  38.  * express or implied warranty.
  39.  */
  40.  
  41. #ifndef lint
  42. static char rcsid[] = "$Header: /sprite/lib/forms/RCS/proto.c,v 1.5 91/02/09 13:24:44 ouster Exp $ SPRITE (Berkeley)";
  43. #endif /* not lint */
  44.  
  45. #include <quad.h>
  46.  
  47.  
  48. /*
  49.  *----------------------------------------------------------------------
  50.  *
  51.  * Quad_UnsToDouble --
  52.  *
  53.  *    Convert an unsigned quad to a double.
  54.  *
  55.  * Results:
  56.  *    Returns a double that is approximately equal to the given 
  57.  *    integer. 
  58.  *
  59.  * Side effects:
  60.  *    None.
  61.  *
  62.  *----------------------------------------------------------------------
  63.  */
  64.  
  65. double
  66. Quad_UnsToDouble(q)
  67.     u_quad q;
  68. {
  69.     return ((double)0xffffffff + 1) * q.val[QUAD_MOST_SIG]
  70.         + q.val[QUAD_LEAST_SIG];
  71. }
  72. @
  73.